package cn.bdqn.dept.client;

import cn.bdqn.dept.hystirx.DeptClientFallBackFactory;
import cn.bdqn.model.pojo.Dept;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * @Author 徐凤年
 * @Date 2022/3/25 22:05
 * @Version 1.0
 */
@Component
@FeignClient(value = "service-dept",fallbackFactory = DeptClientFallBackFactory.class)
public interface DeptFeignClient {
    @GetMapping("/dept/get/{id}")
    public Dept getDeptId(@PathVariable("id") int id);

    @PostMapping("/dept/add")
    public boolean deptAdd( Dept dept);
    @GetMapping("/dept/list")
    public List<Dept> getDeptList();
}
